
let test = { name: '薛之谦', num: 233 }
const singers = [
    { name: '许嵩', num: 200 },
    { name: '周杰伦', num: 266 },
    { name: '林俊杰', num: 201 },
    { name: '陈奕迅', num: 166 },
    { name: '薛之谦', num: 233 },
    test,
    1,
    NaN
]

// 第二个参数也可以是负数，等于数组长度 + 这个负数

const res = singers.includes(test, 5)
console.log(res);

Array.prototype.my_includes = function(value, start = 0) {
    if(start < 0) start = this.length + start
    const isNaN = Number.isNaN(value)
    for(let i = start; i < this.length; i++) {
        if (this[i] == value || (isNaN && Number.isNaN(this[i]))) {
            return true
        }
    }
    return false
}